package com.myccb.app.view.investment;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.myccb.app.R;

public class Template1 extends Fragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(
                R.layout.template1_targets_investment, container, false);
        ((TextView)(view.findViewById(R.id.T11))).setTextAppearance(
                getActivity(), R.style.TextStyle_investment);
        ((TextView)(view.findViewById(R.id.T12))).setTextAppearance(
                getActivity(), R.style.TextStyle_investment);
        ((TextView)(view.findViewById(R.id.T13))).setTextAppearance(
                getActivity(), R.style.TextStyle_investment);
        LinearLayout linearLayout = view.findViewById(R.id.template1_targets);
        LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
        for (int i = 0; i < 6; i ++) {
            if (linearLayout.getChildCount() > 7)
                break;
            View view1 = layoutInflater.inflate(R.layout.template1_targets_investment, linearLayout, false);
            ((TextView)(view1.findViewById(R.id.T11))).setText(DataSet.DATES[i]);
            ((TextView)(view1.findViewById(R.id.T12))).setText(DataSet.ADDITIONAL[i]);
            ((TextView)(view1.findViewById(R.id.T13))).setText(DataSet.BENE_PERC[i]);
            linearLayout.addView(view1);
        }
        return view;
    }
}
